// pages/car-information/index.js
Page({
  /**
   * 页面的初始数据
   */
  data: {
    id:3092889699900293,
    licensePlate:'京GA8765',
    truckType:'厢式货车',
    currentOrganName:'北京中转站',
    allowableLoad:'2',
    picture:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad() {
  const app = getApp()
  // 如果有token，就发一次请求，拿到个人信息
  if (app.getToken()) {
    this.getProfile()
  }
  },
  async getProfile() {
    const { id, licensePlate,truckType, allowableLoad,picture} = await wx.$http.get('/driver/users/truck')
    console.log({ id, licensePlate,truckType, allowableLoad,picture})
    // 更新当前页面数据
    this.setData({ id, licensePlate,truckType, allowableLoad,picture})
  }
})